'use strict';
//暴漏定义的模块方法
exports.getWeatherInfoByCityName = getWeatherInfoByCityName;


function getWeatherInfoByCityName(cityName) {
	var courseData;
	url = url + "/" + cityName + "/";
	//请求数据
	var req = http.get(url, function (res) {
		var html = '';
		//获取数据
		res.on('data', function (data) {
			html += data;});

		//获取数据结束
		res.on('end', function () {
			courseData = praseHtml(html);
			//把数据保存到数据库
			saveWeatherAQi(cityName, courseData);});}).

	on('error', function () {//获取错误的时候的处理
		console.log('获取课程数据失败！');});}